// 主界面
;define(function(require, exports, module) {
  'use strict';
  var util = require("util");
  var base = require("base");
  var validate = require("validate");
  var dialog = require("dialog");
 	var topMenu = require("../topMenu/topMenu");
  var databind = require("databind");
	var css_personal_info = require("./personalInfo.css");
  var init = function(){
    topMenu.init();
    $(".table-section").removeClass("none");
    $(".footer").removeClass("none");
    initEvent();
    loadData();
  };
  var loadData = function(){
		$("#personalInfo").find(".field-input-empCode").attr("readonly","readonly");
    databind.fillInput($("#personalInfo"),{action:"inquireCurrentAccountEmployeeInfo.json",version:"v3.0"});
  
  };
  var initEvent = function(){
  	//若未登录，则返回登陆页面
		if(base.getData("sid")==null||base.getData("sid")==""||base.getData("sid")==undefined){
			location.href="../../../platform/login/login.html";
		}
    $("#personalInfo").on("click",".button-back",function(){
      window.history.go(-1);
    });
    
     $("#personalInfo").on("click",".button-submit",function(){
      databind.enableInput($("#personalInfo"));
      databind.submitDom($("#personalInfo"),message());
    });
  };
  
  var message = function(){
  	 base.alert(1,"修改物流企业信息成功");
  }
  return {
    init:init
  };
});
